package main

import (
	"fmt"
	"time"
)

func main() {
	message := make(chan string) // 声明时定义 通道:协程间通信管道
	go func() {                  // 协程
		message <- "Hello goroutine!" // 指向channel 写入，反之写出
	}()

	go func() {
		time.Sleep(2 * time.Second)
		str := <-message // channel 读出消息
		str = str + "aqie"
		message <- str
	}()

	time.Sleep(3 * time.Second)
	fmt.Println(<-message)
	fmt.Println("Hello Golang")
}
